package com.kl.drs.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.kl.drs.bean.bo.CCBLCContBO;
import com.kl.drs.bean.bo.DrsLdcomRelationBO;
import com.kl.drs.bean.bo.LaAgentBO;
import com.kl.drs.bean.bo.RelationIdBO;
import com.kl.drs.bean.bo.RelationMappingBO;
import com.kl.drs.bean.dto.CoreInfoDTO;
import com.kl.drs.bean.dto.PSBCInfoDTO;
import com.kl.drs.mapper.core.LCContMapper;
import com.kl.drs.mapper.core.LCPolMapper;
import com.kl.drs.mapper.core.LKTransStatusMapper;
import com.kl.drs.mapper.drs.BankButtjointMapper;

@Service("bankButtjointDAO")
public class BankButtjointDAO {
	@Autowired 
	private BankButtjointMapper bankButtjointMapper;
	@Autowired 
	private LKTransStatusMapper lkTransStatusMapper;
	@Autowired 
	private LCContMapper lcContMapper;
	@Autowired 
	private LCPolMapper lcPolMapper;
	/**
	 * 新增关联证件
	 */
	public int addIdTypeRel(RelationIdBO relationIdBO){
		
		return this.bankButtjointMapper.addIdTypeRel(relationIdBO);
	}
	/**
	 * 新增关联编码
	 */
	public int addMappingTypeRel(RelationMappingBO relationMappingBO){
		
		return this.bankButtjointMapper.addMappingTypeRel(relationMappingBO);
	}
	/**
	 * 查询核心数据库的产品名称和缴费方式(建行)
	 */
	public List<CCBLCContBO> queryCoreInfoList(String contNo){
		
		return this.lcContMapper.queryCoreInfoList(contNo);
	}
	/**
	 * 查询关联证件
	 */
	public RelationIdBO queryIdTypeRel(Map<String, String> condMap){
		
		return this.bankButtjointMapper.queryIdTypeRel(condMap);
	}
	/**
	 * 查询关联机构(机构编码和机构类型)
	 */
	public RelationMappingBO queryMappingTypeRel(Map<String, String> condMap){
		
		return this.bankButtjointMapper.queryMappingTypeRel(condMap);
	}
	/**
	 * 查询邮储核心列表信息
	 */
	public List<PSBCInfoDTO> queryCoreInfo(String prtNo){
		
		return this.lkTransStatusMapper.queryCoreInfo(prtNo);
	}
	/**
	 * 根据原保险公司流水号查询投保信息(建行)
	 */
	public CCBLCContBO queryContNo(String serialNo){
		
		return this.lkTransStatusMapper.queryContNo(serialNo);
	}
	/**
	 * 根据保单号查询险种和缴费信息(建行)
	 */
	public List<CCBLCContBO> queryCoreRisk(String contNo){
		
		return this.lcPolMapper.queryCoreInfoList(contNo);
	}
	
	/**
	 * 联查查询关联机构
	 * @param relationCode
	 * @param bankRelationType
	 * @param reRelationType
	 * @return
	 */
	public String queryIdcodeByUnion(String relationCode,String bankRelationType,String reRelationType){
		return bankButtjointMapper.queryIdcodeByUnion(relationCode, bankRelationType, reRelationType);
	}
	
	
	/**
	 * 条件查询核心新单数据
	 * @param queryMap
	 * @return
	 */
	public CoreInfoDTO queryCoreLCbyBusinessNo(Map<String, String> queryMap){
		return lkTransStatusMapper.queryCoreLCbyBusinessNo(queryMap);
	}
	/**
	 * 条件查询核心（撤单、犹退、退保）数据
	 * @param queryMap
	 * @return
	 */
	public CoreInfoDTO queryCoreLBbyBusinessNo(Map<String, String> queryMap){
		return lkTransStatusMapper.queryCoreLBbyBusinessNo(queryMap);
	}

	/**
	 * 查询机构关联
	 * @param manageCom
	 */
	public DrsLdcomRelationBO queryDrsLdcomRel(@Param("manageCom") String manageCom){
		return this.bankButtjointMapper.queryDrsLdcomRel(manageCom);
	}
	
	/**
	 * 查询销售人员信息
	 * @param bankCode
	 * @param bankBranch
	 * @param bankNode
	 */
	public LaAgentBO queryAgentName(Map<String, String> conMap) {
			return lkTransStatusMapper.queryAgentName(conMap);
	}

	
}
